package net.sky.oa.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * 用户短信信息表
 * SmsInfo. @author hond
 */
@Entity
@Table(name = "SMS_INFO")//用户短信信息表
public class SmsInfo implements java.io.Serializable {

	private static final long serialVersionUID = 5673991033245515351L;
	
	// Fields

	protected Long id;
	private String account;     //账号
	private String port;        //端口号
	private String password;    //密码
	private Integer remaincount;//剩余条数
	private Integer sendcount;  //已发条数
	private Integer amountcount;//总分配条数
	private SysEmployee user;     //用户id
	// Constructors

	/** default constructor */
	public SmsInfo() {
	}
	
	@Id
    @Column(name = "ID", unique = true, nullable = false)
	@SequenceGenerator(name="SQ_SMSINFO_ID",sequenceName="SQ_SMSINFO_ID",allocationSize=1)
	@GeneratedValue(strategy=GenerationType.SEQUENCE,generator="SQ_SMSINFO_ID")
	public Long getId() {
        return id;
    }

    public void setId(Long id){
    	this.id = id;
    }

	/** minimal constructor */
	public SmsInfo(Long id) {
		this.id = id;
	}
	
	@Column(name = "ACCOUNT", length = 20)
	public String getAccount() {
		return this.account;
	}

	public void setAccount(String account) {
		this.account = account;
	}

	@Column(name = "PORT", length = 25)
	public String getPort() {
		return this.port;
	}

	public void setPort(String port) {
		this.port = port;
	}

	@Column(name = "PASSWORD", length = 20)
	public String getPassword() {
		return this.password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	@Column(name = "REMAINCOUNT", precision = 5, scale = 0)
	public Integer getRemaincount() {
		return this.remaincount;
	}

	public void setRemaincount(Integer remaincount) {
		this.remaincount = remaincount;
	}

	@Column(name = "SENDCOUNT", precision = 6, scale = 0)
	public Integer getSendcount() {
		return this.sendcount;
	}

	public void setSendcount(Integer sendcount) {
		this.sendcount = sendcount;
	}

	@Column(name = "AMOUNTCOUNT", precision = 6, scale = 0)
	public Integer getAmountcount() {
		return this.amountcount;
	}

	public void setAmountcount(Integer amountcount) {
		this.amountcount = amountcount;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "USER_ID")
	public SysEmployee getUser() {
		return this.user;
	}

	public void setUser(SysEmployee user) {
		this.user = user;
	}

}